package com.campus.commons.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;

import com.campus.app.mapper.Insert;
import com.campus.app.mapper.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 任务表
 * </p>
 *
 * @author Rin
 * @since 2020-12-24
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="Event对象", description="任务表")
public class Event implements Serializable {

    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "任务名称")
    @TableField("eventName")
    @NotBlank(groups = Insert.class)
    @Length(groups = {Insert.class, Update.class},min = 3,max = 30,message = "任务名称不符合规范")
    private String eventName;

    @ApiModelProperty(value = "加分值")
    @TableField("eventScore")
    @Min(1)
    @NotNull(groups = Insert.class)
    private Integer eventScore;

    @ApiModelProperty(value = "任务内容")
    @TableField("eventMess")
    @NotBlank(groups = Insert.class)
    @Length(min = 4,max = 500,message = "任务内容不符合规范")
    private String eventMess;

    @ApiModelProperty(value = "任务备注")
    @TableField("eventRemark")
    private String eventRemark;

    @ApiModelProperty(value = "区分任务1：固定2：自定义")
    @TableField("eventJudge")
    private Integer eventJudge;


    @ApiModelProperty(value = "部门编号")
    @TableField("deId")
    @Min(1)
    private Integer deId;

    @ApiModelProperty(value = "任务状态：0未领取，1.已领取，2.完成了，3.未完成")
    @TableField("state")
    @Min(0)
    private Integer state;

    @ApiModelProperty(value = "领取的学生Id")
    @TableField("studentId")
    @Min(1)
    private Integer studentId;

    public Event(Integer id, Integer studentId) {
        this.id=id;
        this.studentId=studentId;
    }
}
